package com.besttone.kafka.producer;

import org.apache.kafka.clients.producer.RecordMetadata;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.support.ProducerListenerAdapter;
import org.springframework.stereotype.Component;

@Component
public class MyProducerListener extends ProducerListenerAdapter<String, String> {
	Logger logger=LoggerFactory.getLogger(getClass());
	@Override
	public void onError(java.lang.String topic, Integer partition, String key, String value, Exception exception) {
		logger.error("{}{}{}{}{}",topic,partition,key,value,exception.getMessage());
		
	}
	
	@Override
	public void onSuccess(java.lang.String topic, Integer partition, String key, String value,
			RecordMetadata recordMetadata) {
		logger.error("{}{}{}{}{}",topic,partition,key,value,recordMetadata.checksum());
	}
	
	
	

}
